The provided key/value pair was updated in the provided transaction
Syntax
Parameters
- token
- key
- value
Example
BPlusTree/BPlusTree.Test/TestTransactionLog.cs
C# | Copy Code |
---|
using (TempFile tmp = new TempFile())
using (var log = new TransactionLog<int, string>(Options(tmp)))
{
var token = log.BeginTransaction();
log.UpdateValue(ref token, 1, "test");
log.CommitTransaction(ref token);
var test = new Dictionary<int, string>();
test.Add(1, null);
log.ReplayLog(test);
Assert.AreEqual(1, test.Count);
Assert.IsTrue(test.ContainsKey(1));
Assert.AreEqual("test", test[1]);
} |
VB.NET | Copy Code |
---|
Using tmp As New TempFile()
Using log As var = New TransactionLog(Of Integer, String)(Options(tmp))
Dim token As var = log.BeginTransaction()
log.UpdateValue(token, 1, "test")
log.CommitTransaction(token)
Dim test As var = New Dictionary(Of Integer, String)()
test.Add(1, Nothing)
log.ReplayLog(test)
Assert.AreEqual(1, test.Count)
Assert.IsTrue(test.ContainsKey(1))
Assert.AreEqual("test", test(1))
End Using
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also